package com.atguigu.gulimall.product;

import java.util.Scanner;

public class test {
    public static void main(String[] args) {

        ArrayQeuee qeuee = new ArrayQeuee(3);
        char key = ' ';
        Scanner scanner = new Scanner(System.in);
        boolean loop = true;
        while (loop){
            System.out.println("s(show):显示队列");
            System.out.println("e(show):退出程序");
            System.out.println("a(show):添加队列");
            System.out.println("g(show):取出队列");
            System.out.println("h(show):查看队列头的数据队列");
            key = scanner.next().charAt(0);
            switch (key){
                case('s'):
                    qeuee.show();
                    break;
                case('a'):
                    System.out.println("请输入一个数");
                    int i = scanner.nextInt();
                    qeuee.add(i);
                    break;

                case('g'):
                    int i1 = qeuee.get();
                    System.out.println(i1);
                    break;
                case('e'):
                    loop = false;
                    break;
                default:
                    break;
            }
        }

    }
}
